<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <title>title</title>
    <link rel="stylesheet" type="text/css" href="../css/api.css" />
    <link rel="stylesheet" type="text/css" href="../css/aui.css" />
    <style>
        body {
            font-size: 20px;
            background-color: #fff;
        }

        header {
            background-color: #336699;
        }

        #main {
            -webkit-box-flex: 1;
            -webkit-flex: 1;
            background-color: #fff;
        }

        section {
            background-color: #fff;
        }

        h1 {
            height: 2.5rem;
            line-height: 2.5rem;
            color: #fff;
            font-size: 20px;
            text-align: center;
        }

        .back {
            position: absolute;
            left: 0px;
            bottom: 0px;
            width: 2.5rem;
            height: 2.5rem;
            background: url(../image/header/back.png) center center no-repeat;
            background-size: 25px auto;
        }

        .kuang {
            width: 100%;
            height: 150px;
            padding: 15px;
            border: solid 1px #f0f0f0;
            border-radius: 3px;
            box-shadow: 0 5px 5px #f1f1f1;
        }

        .kuang .right {
            width: 76px;
            height: 76px;
            float: right;
        }

        .kuang .right .yuan {
            float: right;
            width: 50px;
            height: 50px;
            border-radius: 50%;
            background-color: #3396fb;
            text-align: center;
            line-height: 56px;
            font-size: .9rem;
            color: #fff;
            margin: 13px auto;
        }

        .kuang .left {
            width: 70%;
            height: 62px;
            line-height: 1.8rem;
            font-size: 1.2rem;
            padding-top: .8rem;
            float: left;
            /*border-bottom: solid 1px #fafafa;*/
            text-align: left;
        }

        .kuang .left .gangwei {
            font-size: .8rem;
            padding-top: .8rem;
            line-height: 1.7rem;
            color: #666;
        }

        .myhang {
            /*width: 100%;*/
            height: 76px;
            margin: 1.2rem auto;
            font-size: .8rem;
            line-height: 76px;
        }

        .myhang .left {
            width: 40%;
            height: 76px;
            float: left;
        }

        .hang .left .hangitem {
            color: #666;
            font-size: .6rem;
        }

        .hang .left .hangcontent {
            font-size: .8rem;
        }

        .myhang .right {
            width: 60%;
            height: 76px;
            float: right;
            text-align: left;
        }

        .aui-list .aui-list-item-label, .aui-list .aui-list-item-label-icon {
            line-height: 2rem;
        }
        .aui-btn {
            font-size: 1rem;
            height: 2rem;
            line-height: 2rem;
        }
    </style>
</head>

<body>
    <header id="header">
        <div id="bikeclose" class="back event-back" tapmode onclick="api.closeWin({name:'my_editinfo'});"></div>
        <h1 id="pagetitle">个人信息</h1>
    </header>
    <section style="width:92%; margin:8px auto 0px auto; ">
        <p class="aui-text-left" style="color:#e33; line-height:20px; padding-bottom:8px;">　　禁止用户自行修改个人信息。</p>
        <div class="aui-content aui-margin-b-15">
            <ul class="aui-list aui-form-list">
                <li class="aui-list-item">
                    <div class="aui-list-item-inner">
                        <div class="aui-list-item-label">
                            省份：
                        </div>
                        <div class="aui-list-item-input">
                            <span id="province"></span>
                        </div>
                    </div>
                </li>
                <li class="aui-list-item">
                    <div class="aui-list-item-inner">
                        <div class="aui-list-item-label">
                            城市：
                        </div>
                        <div class="aui-list-item-input">
                            <span id="city"></span>
                        </div>
                    </div>
                </li>
                <li class="aui-list-item">
                    <div class="aui-list-item-inner">
                        <div class="aui-list-item-label">
                            区县：
                        </div>
                        <div class="aui-list-item-input">
                            <span id="county"></span>
                        </div>
                    </div>
                </li>
                <li class="aui-list-item">
                    <div class="aui-list-item-inner">
                        <div class="aui-list-item-label">
                            姓名：
                        </div>
                        <div class="aui-list-item-input">
                            <span id="name"></span>
                        </div>
                    </div>
                </li>
                <li class="aui-list-item">
                    <div class="aui-list-item-inner">
                        <div class="aui-list-item-label">
                            性别：
                        </div>
                        <div class="aui-list-item-input">
                            <span id="gender">男</span>
                        </div>
                    </div>
                </li>
                <li class="aui-list-item">
                    <div class="aui-list-item-inner">
                        <div class="aui-list-item-label">
                            手机：
                        </div>
                        <div class="aui-list-item-input">
                            <span id="mobile"></span>
                        </div>
                    </div>
                </li>

            </ul>
        </div>
    </section>
</body>
<script type="text/javascript" src="../script/api.js"></script>
<script type="text/javascript" src="../script/bike.js"></script>
<script type="text/javascript" src="../script/doT.min.js"></script>
<script type="text/javascript">
    apiready = function() {
        var userinfo = $api.getStorage('userinfo');
        // alert(JSON.stringify(userinfo));

        if(typeof userinfo != "undefined" && userinfo.uid){
            api.showProgress({
                title: '正在加载...',
                modal: false
            });
            var apipath = $api.getStorage('apipath');
            var apiurl = apipath+"/Xjxtapi/getUserinfoDetail";

            api.ajax({
                url: apiurl,
                method: 'post',
                timeout: 5,
                dataType: 'json',
                returnAll: false,
                data: {
                    values: {
                        apiuser: getConfigValue('apiuser'),
                        apipass: getConfigValue('apipass'),
                        uid: userinfo.uid
                    }
                }
            }, function(ret5, err) {
                api.hideProgress();
                if (ret5) {
                    // alert(JSON.stringify(ret5));
                    $api.text($api.byId('province'),ret5.userinfo.province);
                    $api.text($api.byId('city'),ret5.userinfo.city);
                    $api.text($api.byId('county'),ret5.userinfo.county);
                    $api.text($api.byId('school'),ret5.userinfo.school_name);
                    $api.text($api.byId('class'),ret5.userinfo.class_name);
                    $api.text($api.byId('name'),ret5.userinfo.name);
                    // $api.text($api.byId('gender'),ret5.userinfo.gender);
                    $api.text($api.byId('mobile'),ret5.userinfo.mobile);
                } else {
                    //无数据
                }
            });
        }
    };

    function changepass(){
        var userinfo = $api.getStorage('userinfo');
        var uid = userinfo.uid;
        var tel = $api.val($api.byId('tel'));
        var room = $api.val($api.byId('room'));
        var fax = $api.val($api.byId('fax'));

        //alert(usernametext);

        if(tel=="")
        {
            alert('电话不能为空');
        }
        else
        {
            if(room=="")
            {
                alert('房间不能为空');
            }
            else
            {
                if(fax=="")
                {
                    alert('传真不能为空');
                }

                else
                {

                            var apiurl = getConfigValue('apiurl')+"Gdxtapi/editinfo";
                            api.ajax({
                                url: apiurl,
                                method: 'post',
                                timeout: 5,
                                dataType: 'json',
                                returnAll: false,
                                data:{
                                    values: {
                                        apiuser:getConfigValue('apiuser'),
                                        apipass:getConfigValue('apipass'),
                                        uid: uid,
                                        tel: tel,
                                        room: room,
                                        fax: fax
                                    }
                                }
                            }, function(ret, err) {
                                //alert(JSON.stringify(ret));
                                alert(ret.remsg);
                                if(ret.renum=='1')
                                {
                                    $api.setStorage('userinfo.tel', tel);
                                    $api.setStorage('userinfo.room', room);
                                    $api.setStorage('userinfo.fax', fax);
                                    // localStorage.setItem(userinfo.tel,tel);
                                    // localStorage.setItem(userinfo.room,room);
                                    // localStorage.setItem(userinfo.fax,fax);
                                    api.closeWin({name:'my_editinfo'});
                                }
                            });



                }
            }
        }
    }
</script>

</html>
